// 学生类
public class Student {
    // 属性（成员变量）
    String name;
    int age;
    double score;
    
    // 构造方法
    public Student(String name, int age, double score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }
    
    // 默认构造方法
    public Student() {
        this.name = "未知";
        this.age = 0;
        this.score = 0.0;
    }
    
    // 方法（成员方法）
    public void displayInfo() {
        System.out.println("姓名: " + name + ", 年龄: " + age + ", 成绩: " + score);
    }
    
    public void study() {
        System.out.println(name + "正在学习...");
        score += 0.5; // 学习后成绩提高
    }
    
    // getter 和 setter 方法
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public int getAge() {
        return age;
    }
    
    public void setAge(int age) {
        if (age > 0 && age < 150) {
            this.age = age;
        }
    }
    
    public double getScore() {
        return score;
    }
    
    public void setScore(double score) {
        this.score = score;
    }
}
